Component({
  properties: {
    text: {
      type: String,
      value: '加载中...'
    },
    color: {
      type: String,
      value: '#0066cc'
    },
    size: {
      type: String,
      value: 'default' // default, small, large
    }
  },
  
  data: {
    sizeClass: ''
  },
  
  lifetimes: {
    attached() {
      let sizeClass = '';
      switch(this.data.size) {
        case 'small':
          sizeClass = 'loading-small';
          break;
        case 'large':
          sizeClass = 'loading-large';
          break;
        default:
          sizeClass = '';
      }
      
      this.setData({
        sizeClass
      });
    }
  }
}) 